package com.alibaba.serverless.dao.impl;

import com.alibaba.serverless.common.util.SqlSessionUtil;
import com.alibaba.serverless.dao.SmtpTemplateDao;
import com.alibaba.serverless.domain.SmtpTemplate;
import org.apache.ibatis.session.SqlSession;

/**
 * 邮件模板Dao层实现
 * @author mac_zyj
 */
public class ISmtpTemplateDaoImpl implements SmtpTemplateDao {
    private SqlSession sqlSession;
    @Override
    public SmtpTemplate selectTemplateByName(String templateName) {
        sqlSession= SqlSessionUtil.getSession();
        try {
            return sqlSession.selectOne("com.alibaba.serverless.dao.SmtpTemplateDao.selectTemplateByName",templateName);
        }finally {
            sqlSession.close();
        }
    }
}
